package com.stlm2.dems.entity;

/**
 * Created by apple on 2017/10/20.
 */
public enum PayType {
    OnLine(1) {
        public String toString() {
            return "网上支付";
        }
    },
    ToShop(2) {
        public String toString() {
            return "到店支付";
        }
    },
    ByBank(3) {
        public String toString() {
            return "银行转账";
        }
    },
    Installment(4){
        public String toString() {
            return "分期支付";
        }
    };

    private final int val;

    PayType(int n) {
        val = n;
    }

    public int getIntValue() {
        return val;
    }

    public static PayType getByIntValue(int n) {
        switch (n) {
            case 1:
                return OnLine;
            case 2:
                return ToShop;
            case 3:
                return ByBank;
            case 4:
                return Installment;
            default:
                return null;
        }
    }
}
